import App from './App'

import {
	createUnistorage
} from "./uni_modules/pinia-plugin-unistorage";
import {
	useStore
} from './store';
import messages from './locales/index.js'
let i18nConfig = {
    locale: uni.getLocale(),
	 // locale: store.locales,
    messages
}
import { createI18n } from 'vue-i18n'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import * as Pinia from "pinia";
import uviewPlus from './uni_modules/uview-plus'
const i18n = createI18n(i18nConfig)
export function createApp() {
  const app = createSSRApp(App)
  const store = Pinia.createPinia();
  store.use(createUnistorage());
  app.use(store)
  app.use(i18n)
  app.use(uviewPlus)
  return {
    app,
	Pinia
  }
}
// #endif